<%--
  Created by IntelliJ IDEA.
  User: mr.circle
  Date: 2020/7/2
  Time: 10:12 上午
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>wps在线编辑</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" href="/lib/layui/layui/css/eleTree.css?2019101815.40">
    <link rel="stylesheet" href="/lib/layui/layui/css/treeTable.css?2019101815.17">
    <link rel="stylesheet" href="/lib/layui/layui/css/layui.css">
    <link rel="stylesheet" href="/lib/layui/layui/css/modules/layer/default/layer.css">
    <link rel="stylesheet" href="/lib/layui/layui/css/layui.css">
    <script type="text/javascript" src="/js/jquery/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="/lib/layui/layui/layui.js"></script>
    <script type="text/javascript" src="/lib/layui/layui/layui.all.js"></script>
    <script type="text/javascript" src="/js/base/base.js"></script>
    <script type="text/javascript" src="/lib/layui/layui/global.js"></script>
    <script src="web-office-sdk.umd.js"></script>
    <script src="//unpkg.com/promise-polyfill@8.1.3/dist/polyfill.min.js"></script>
    <script src="web-office-sdk.umd.js"></script>

    <style>
        .layui-padding{
            margin-left: 400px;
        }
        .shili{
            margin-left: 0px;
        }
        .a{
            margin-left: 15px;
            padding-top: 15px;
        }
        form{
            margin-left: 15px;
        }
        .b{
            margin-left: 15px;
            margin-top: 20px;
            padding-bottom: 15px;

        }

    </style>
</head>
<body>
<div class="a">
<form id="form" action="" method="post">
    文档名：<input type="text" name="_w_fname" value="wps.docx" id="1">
    文件id：<input type="text" name="_w_fileid" value="wps" id="2">
    路径：<input type="text" name="_w_fpath"  id="3">

    <input type="button" onclick="tes()" value="拼接">
</form>

<p class="b">Word文档：<a id="tt" href="https://wwo.wps.cn/office/w/841478147?">点击阅览</a></p>

</div>
<script>
    function tes(){
        var str=encodeURIComponent($("#3").val());
        $.ajax({
            url:"/v1/3rd/file/info",    //请求的url地址
            dataType:"json",   //返回格式为json
            async:true,//请求是否异步，默认为异步，这也是ajax重要特性
            data:{_w_fpath:str,
            _w_fname:$("#1").val(),
            _w_fileid:$("#2").val()
        },    //参数值    //参数值
            type:"GET",   //请求方式

            success:function(req){

                var obj = req.signature


                $("#tt").attr("href","https://wwo.wps.cn/office/w/841478147?"+obj)

            }
        });
    }


</script>

</body>
</html>
